package de.gameduell.framework.application.level {
	import de.gameduell.framework.security.SecureNumber;

	import flash.events.EventDispatcher;

	/**
	 * @author daal
	 */
	public class Level extends EventDispatcher {

		private var _isStarted:Boolean;
		private var _isPaused:Boolean;
		protected var _isComplete:Boolean;
		//do we need this here?
		protected var _score:SecureNumber;

		public function Level() {
			_isComplete = false;
			_score = new SecureNumber(0);
		}

		public function get isComplete():Boolean {
			return _isComplete;
		}

		public function set isComplete(isComplete:Boolean):void {
			_isComplete = isComplete;
		}

		public function get isStarted():Boolean {
			return _isStarted;
		}

		public function set isStarted(isStarted:Boolean):void {
			_isStarted = isStarted;
		}

		public function get isPaused():Boolean {
			return _isPaused;
		}

		public function set isPaused(isPaused:Boolean):void {
			_isPaused = isPaused;
		}

		public function start():void {
			_isStarted = true;
			dispatchEvent(new LevelEvent(LevelEvent.LEVEL_START));
		}

		public function complete():void {
			_isComplete = true;
			dispatchEvent(new LevelEvent(LevelEvent.LEVEL_COMPLETE));	
		}

		public function fail():void {
			dispatchEvent(new LevelEvent(LevelEvent.LEVEL_FAIL));
		}
	}
}
